export default {
    namespaced: true,
    state: {
        list: [{
                msg: "明天是周天爱干啥干啥",
                finish: true
            },
            {
                msg: "呵呵哒",
                finish: false
            }
        ]
    },
    getters: {
        showList(state){
            console.log(state.list)
            var result=state.list.filter((item)=>{
                console.log(item.finish)
                if(item.finish==false){
                    return item.finish
                }
            })
            return result
        }
    },
    mutations: {
        addList(state, params) {
            state.list.push({
                msg: params.msg,
                finish: false
            })
        },
        delList(state, params) {
            console.log("state→", state, )
            console.log("params→", params)
            state.list.splice(params.index, 1)
        },
        // wancheng(state, params) {

        // },
        wancheng(state, params) {
            state.list[params.index].finish = true
        }
    },
    actions: {

    }
}